
//% color="#ef784c" iconWidth=50 iconHeight=40
namespace Unihiker_PrintScreen{

    //% block="行空板截屏,起点X[X],Y[Y],宽[W],高[H],保存为[FILENAME]" blockType="command"
    //% X.shadow="number" X.defl="0"
    //% Y.shadow="number" Y.defl="0"
    //% W.shadow="number" W.defl="240"
    //% H.shadow="number" H.defl="320"
    //% FILENAME.shadow="string" FILENAME.defl="img.png"
    export function print_screen_handle(parameter: any, block: any) {
        let x=parameter.X.code;
        let y=parameter.Y.code;
        let w=parameter.W.code;
        let h=parameter.H.code;
        let filename=parameter.FILENAME.code;
        Generator.addImport(`from print_screen import print_screen_handle`);
        Generator.addCode(`print_screen_handle(${x}, ${y}, ${w}, ${h}, ${filename})`);
    }

}
